package vashion.azeroth.api.controller.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import vashion.azeroth.core.personal.tran.pojo.PersonalDisburse;
import vashion.azeroth.core.service.tran.PersonalDisburseService;


public class RecalculateController {
	
	private final static Logger logger = LoggerFactory.getLogger(RecalculateController.class);
	
	private Boolean isOpen;
	
	@Autowired
	private PersonalDisburseService<PersonalDisburse> disburseService;

	public void recalculate() {
		if(isOpen) {
			logger.info("重算订单金额任务开始");
			disburseService.recalculate();
			logger.info("重算订单金额任务结束");
		}
	}

	public Boolean getIsOpen() {
		return isOpen;
	}

	public void setIsOpen(Boolean isOpen) {
		this.isOpen = isOpen;
	}

}
